package chat.network.tcp;

/**
 * 定时检查模块
 * Created by Administrator on 2016/3/30.
 */
public class TimeCheck {
    static TimeCheck timeCheck = new TimeCheck();
    public static TimeCheck share()
    {
        return timeCheck;
    }

    long checekedTime;

    public synchronized void init()
    {
        checekedTime = System.currentTimeMillis();
    }

    public synchronized void setChecekedTime()
    {
        checekedTime = System.currentTimeMillis();
    }

    public synchronized long getChecekedTime()
    {
        return checekedTime;
    }

    // 是否超时,超过1分半则超时
    public synchronized boolean isTimeOut()
    {
        long now = System.currentTimeMillis();
        if (now-checekedTime > 90000)
        {
            return true;
        }
        return false;
    }


}
